const axios = require('axios'),
      qs = require('qs');

class Model {
  axiosPost (options) {
      axios({
          url: options.url,
          method: 'post',
          header: {
              'Content-type': 'application/x-www-form-urlencoded'
          },
          data: qs.stringify(options.data)
      }).then(res => {
          options.success(res.data);
      }).catch(err => {
          options.error(err);
      })
  }
}

module.exports = Model;

